Skip to content

Conversation

RulaKhaled
Copy link
Member

@RulaKhaled RulaKhaled commented Oct 2, 2025

We are exposing AI instrument methods for Anthropic, Google GenAI, and OpenAI, enabling users to use it directly from browser sdk.

Copy link

linear bot commented Oct 2, 2025

Copy link
Contributor

github-actions bot commented Oct 6, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,764 - 8,966 -2%
GET With Sentry 1,295 15% 1,412 -8%
GET With Sentry (error only) 5,943 68% 6,242 -5%
POST Baseline 1,169 - 1,211 -3%
POST With Sentry 494 42% 531 -7%
POST With Sentry (error only) 1,036 89% 1,089 -5%
MYSQL Baseline 3,237 - 3,373 -4%
MYSQL With Sentry 355 11% 484 -27%
MYSQL With Sentry (error only) 2,630 81% 2,768 -5%

View base workflow run

Copy link
Contributor

github-actions bot commented Oct 13, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.48 kB - -
@sentry/browser - with treeshaking flags 22.96 kB - -
@sentry/browser (incl. Tracing) 40.67 kB - -
@sentry/browser (incl. Tracing, Replay) 79.03 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.69 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.72 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.9 kB - -
@sentry/browser (incl. Feedback) 41.17 kB - -
@sentry/browser (incl. sendFeedback) 29.14 kB - -
@sentry/browser (incl. FeedbackAsync) 34.11 kB +0.17% +57 B 🔺
@sentry/react 26.19 kB - -
@sentry/react (incl. Tracing) 42.62 kB - -
@sentry/vue 28.99 kB - -
@sentry/vue (incl. Tracing) 42.44 kB - -
@sentry/svelte 24.51 kB - -
CDN Bundle 26.75 kB +0.2% +53 B 🔺
CDN Bundle (incl. Tracing) 41.29 kB +0.16% +64 B 🔺
CDN Bundle (incl. Tracing, Replay) 77.57 kB +0.07% +49 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.04 kB +0.08% +60 B 🔺
CDN Bundle - uncompressed 78.49 kB +0.21% +164 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 122.49 kB +0.14% +164 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 237.65 kB +0.07% +164 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 250.41 kB +0.07% +164 B 🔺
@sentry/nextjs (client) 44.71 kB - -
@sentry/sveltekit (client) 41.05 kB - -
@sentry/node-core 50.8 kB -0.01% -1 B 🔽
@sentry/node 154.41 kB - -
@sentry/node - without tracing 92.67 kB -0.01% -1 B 🔽
@sentry/aws-serverless 106.38 kB -0.01% -1 B 🔽

View base workflow run

@RulaKhaled RulaKhaled marked this pull request as ready for review October 14, 2025 09:08
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I had a suggestion for the test setup but feel free to tackle it in a follow-up PR.

Also, let's make sure we document the integraitons, including the CDN addon bundles, in our integrations docs pages.

Comment on lines +4 to +6
const mockClient = new MockAnthropic({
apiKey: 'mock-api-key',
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: It isn't ideal for an integration test to mock the client we want to instrument. In our Node integration tests we usually test against the actual libraries (though not sure about AI packages to be fair).

I'm not sure if this works out of the box but we can try adding the packages as dependencies to the browser-integration-tests package.json and then just importing them in the subject files. We bundle each individual integration test suite via webpack so maybe webpack can actually resolve and bundle the dependencies out of the box. If this doesn't work, we should find a way to make this possible. I'm sure this is also a concern for logging libraries used in browser apps.

I'm fine though with merging the PR as-is and following up with replacing the mocks with the actual test apps. Whatever works for you better :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We mock the server apis for AI tests usually, yep can do in a follow up, will draft a ticket for this.

@RulaKhaled RulaKhaled merged commit 6229224 into develop Oct 14, 2025
189 of 190 checks passed
@RulaKhaled RulaKhaled deleted the rolaabuhasna/js-945-expose-ai-integrations-in-browser-sdk branch October 14, 2025 11:01
andreiborza pushed a commit to thedanchez/sentry-javascript that referenced this pull request Oct 15, 2025
…-expose-ai-integrations-in-browser-sdk

feat(browser): Expose AI instrumentation methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants